﻿/**
 * \brief 任务类
 * \file CTask.cc
 */

#include "CTask.h"

/**
 * \brief 进入下一个状态
 */
void CTask::gotoNextState()
{
	switch(this->_M_state)
	{
		case enTaskState_Init:
			{
				this->_M_state = enTaskState_Verify;
			}
			break;
		case enTaskState_Verify:
			{
				this->_M_state = enTaskState_Sync;
			}
			break;
		case enTaskState_Sync:
			{
				this->_M_state = enTaskState_Running;
			}
			break;
		case enTaskState_Running:
			{
				this->_M_state = enTaskState_Recycle;
			}
			break;
		default:
			{
				break;
			}
	}
}

/**
 * \brief 设置为等待回收状态
 */
void CTask::setRecycle()
{
	this->_M_state = enTaskState_Recycle;
}

/**
 * \brief 任务状态
 */
BYTE CTask::getState()
{
	return this->_M_state;
}


